/**
 * Created by wushanxin on 14-3-20.
 */


var http = require('http');

var querystring = require('querystring');


var post_data ={
    "routemac": "5a:bf:5a:3c:0e:41",
    "data": [
        {
            "stamac": "84:38:38:60:9E:EE",
            "ssid": "tipc-test-2.4g",
            "apmac": "00:19:C6:50:44:03",
            "time": "20171104212451"
        },
        {
            "stamac": "14:DD:A9:B7:A1:64",
            "ssid": "",
            "apmac": "",
            "time": "20171104212449",
            "ssidlist": [
                "Dear XY",
                "WX-LWKF",
                "RWKHXXQ",
                "ChinaNet-SSID1"
            ]
        }
    ]
};

var options = {
    host: '121.40.71.160',
    port: 80,
    path: '/scan',
    method: 'POST'
};


var req = http.request(options, function(res) {
    console.log('STATUS: ' + res.statusCode);
    console.log('HEADERS: ' + JSON.stringify(res.headers));
    res.setEncoding('utf8');
    res.on('data', function (chunk) {
        console.log('BODY: ' + chunk);
    });
});

// write data to request body
function reg( )
{
    req.write(JSON.stringify(post_data));
    console.log(req);
    req.end();
}
reg();
//offline();


